import {abstract_point} from "./abstract-point";
import {http} from "./http";

/**
 * 刷考试积分(+20)
 */
export class epoint extends abstract_point{

    /**
     *
     * @param user {user} 对象
     * @param time {Number} 执行次数
     * @param score {Number} 打算考的分数
     * @param value {Number} 每次应该刷多少分
     */
    constructor(user,time=3,score=2,value=20){
        super(user,time);
        this.score=score;
        this.value=value;
    }


    async request(){
        return http.post("/pss/service/postPoint?operateType=epoint" +
            "&userAccount=" + this.user.userAccount +
            "&domainCode=" + this.user.domainCode +
            "&"+"timestamp=" + new Date() +
            "&exerScore=" + this.score +
            "&expointValue=" +this.value +
            "&ssid=" +this.user.sid

        );
    }

}

